Submit data into table based on certain input field in HTML form